<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function f() {
            var zfc = document.getElementById("zfc");
            var result = document.getElementById("result");
            var a=true;
            for (var i=0;i<zfc.value.length;i++) {
             if (zfc.value.charAt(i)!=zfc.value.charAt(zfc.value.length-1-i)){
                 a=false;
             }
            }
            if (a){
                result.innerHTML=zfc.value+"是对称字符串";
            }else {
                result.innerHTML=zfc.value+"不是对称字符串";
            }
        }
    </script>
</head>
<body>
<input id="zfc" type="text"/>
<input type="button" value="开始判断" onclick="f()"/>
<div id="result"></div>
</body>
</html>